mv2adc

Converts millivolt values to Analogue to Digital Converter count values.

Contents

Syntax

Y = mv2adc(X, voltageRange, maxValue)

Description

mv2adc(X, voltageRange, maxValue) returns an Analogue to Digital Converter count value corresponding for the input value X scaled according to the voltage range specified.

Example

X = [-500, -250, 0, 250, 500];
voltageRange = 1000; % ±1 V range
maxValue = 32512;

Y = mv2adc(X, voltageRange, maxValue)
Y =

  1×5 int32 row vector

   -16256    -8128        0     8128    16256

Input Arguments

The units for voltageRange can be changed e.g. volts.

Output Arguments

Note: If a different unit is used for the input X, then Y will have the corresponding units.

See Also

adc2mv

Copyright: © 2015 Pico Technology Ltd. All rights reserved.